package com.cloud.businesscomment.service.serviceImpl;

import com.cloud.businesscomment.dao.Goods_commentsMapper;
import com.cloud.businesscomment.service.GoodscommentService;
import com.cloud.commonapi.model.Goods_comments;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author : 黄永佳
 * create : 2019/9/30 0030 17:35
 * modified :
 * 功能 :
 **/
@Service
public class GoodscommentServiceImpl implements GoodscommentService {
    @Autowired
    Goods_commentsMapper goods_commentsMapper;

    @Override
    public int addpublisher(Goods_comments goods_comments) {
        return goods_commentsMapper.insert(goods_comments);
    }

    @Override
    public int findpublisherId(int orderId) {
        return   goods_commentsMapper.selectReceiveId(orderId);
    }

    @Override
    public int findrecipientId(int orderId) {
        return goods_commentsMapper.selectPublicherId(orderId);
    }

    @Override
    public List<Goods_comments> findById(int id) {
        return goods_commentsMapper.selectByOrderId(id);
    }

    @Override
    public boolean already(Goods_comments goods_comments) {
        if(goods_commentsMapper.ifAlready(goods_comments)!=null){
            return false;
        }else {
            return true;
        }
    }
}
